package by.plisitsa.railway.datamodel;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;


@Entity
public class Route extends AbstractEntity {
	
	@Column
	private Integer startPoint;

	@Column
	private Integer endPoint;
	
	@JoinTable(name = "route_2_distance", joinColumns = { @JoinColumn(name = "route_id") }, inverseJoinColumns = { @JoinColumn(name = "city_id") })
	@ManyToMany(targetEntity = City.class, fetch = FetchType.LAZY)
	private Set<City> citys;
	
	}
